<#assign pojo=oneToManyPojo.getOne()>
<#assign many=oneToManyPojo.getMany()>
<#assign ones=oneToManyPojo.getOnes()>
<#assign fields=pojo.getFilterdPojoFields()>
<#assign declarationName = pojo.importType(pojo.getDeclarationName())>
<#assign declarationNameFirstLetterLower = pojo.importType(pojo.getDeclarationNameFirstLetterLower())>
<#assign realPackageAndClassPath = "${pojo.getRealPackageAndClassPath()}">
<#assign masterid = pojo.getDeclarationNameFirstLetterLower()+"Id">
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'dva'
import styles from '../../themes/detail.less'

const Detail = ({ ${declarationNameFirstLetterLower}Detail }) => {
  const { data } = ${declarationNameFirstLetterLower}Detail
  const content = []
  for (let key in data) {
    if ({}.hasOwnProperty.call(data, key)) {
      content.push(<div key={key} className={styles.item}>
        <div>{key}</div>
        <div>{String(data[key])}</div>
      </div>)
    }
  }
  return (<div className="content-inner">
    <div className={styles.content}>
      {content}
    </div>
  </div>)
}

Detail.propTypes = {
  ${declarationNameFirstLetterLower}Detail: PropTypes.object,
  loading: PropTypes.bool,
}

export default connect(({ ${declarationNameFirstLetterLower}Detail, loading }) => ({ ${declarationNameFirstLetterLower}Detail, loading: loading.models.${declarationNameFirstLetterLower}Detail }))(Detail)
